#!usr/bin/env python  
# -*- coding: utf-8 -*-
""" 
@author:Simon
@file: objdemo17.py 
@time: 2018/01/19 
"""
class Dict(dict):

    def __init__(self, **kw):
        super().__init__(**kw)

    def __getattr__(self, item):
        try:
            return self['item']
        except KeyError:
            raise AttributeError(r"'Dict' object has no attribute '%s'" %key)

    def __setattr__(self, key, value):
        self[key] = value

d = Dict(a=1, b=20)
print(d['a'])
